﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WC.BL.BE;
using WC.DL.DALC.Factory;

namespace WC.BL.BCC
{
    public class TiendaBC
    {
        public static GenericBE read(string pCod)
        {
            List<GenericBE> lst;
            try
            {
                lst = DAOFactory.HelperDALC.getTiendas(pCod, string.Empty, string.Empty);
                if (lst.Count == 1)
                {
                    return lst[0];
                }
                else
                {
                    return null;
                }
            }
            catch { return null; }
        }

        public static List<GenericBE> list()
        {
            List<GenericBE> lst = new List<GenericBE>();
            try { lst = DAOFactory.HelperDALC.getTiendas(string.Empty, string.Empty, string.Empty); }
            catch { }
            return lst;
        }

        public static List<GenericBE> find(string pDesc, string pRazonSocial)
        {
            List<GenericBE> lst = new List<GenericBE>();
            try { lst = DAOFactory.HelperDALC.getTiendas(string.Empty, pDesc, pRazonSocial); }
            catch { }
            return lst;
        }
    }
}
